package com.cbwl.eoas.cms.model.eoas;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


public class AppPictuerDTO extends CommonBean {

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 726555887433238003L;
	
	private java.lang.Long id;
	@Length(max=128)
	private java.lang.String picName;
	@Length(max=256)
	private java.lang.String picUrl;
	@Length(max=5)
	private java.lang.String picType;
	
	private java.lang.Integer picOrder;
	@Length(max=5)
	private java.lang.String picGroup;
	@Length(max=5)
	private java.lang.String picStatus;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	//columns END
	
	private String picTypeName;
	private String picStatusName;
	
	private String datemin;
	private String datemax;
	
	
	
	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setPicName(java.lang.String value) {
		this.picName = value;
	}
	
	public java.lang.String getPicName() {
		return this.picName;
	}
	
	public void setPicUrl(java.lang.String value) {
		this.picUrl = value;
	}
	
	public java.lang.String getPicUrl() {
		return this.picUrl;
	}
	
	public void setPicType(java.lang.String value) {
		this.picType = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.picTypeName = redisValue;
			}
		}
	}
	
	public java.lang.String getPicType() {
		return this.picType;
	}
	
	public void setPicOrder(java.lang.Integer value) {
		this.picOrder = value;
	}
	
	public java.lang.Integer getPicOrder() {
		return this.picOrder;
	}
	
	public void setPicGroup(java.lang.String value) {
		this.picGroup = value;
	}
	
	public java.lang.String getPicGroup() {
		return this.picGroup;
	}
	
	public void setPicStatus(java.lang.String value) {
		this.picStatus = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.picStatusName = redisValue;
			}
		}
	}
	
	public java.lang.String getPicStatus() {
		return this.picStatus;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getPicTypeName() {
		return picTypeName;
	}

	
	public void setPicTypeName(String picTypeName) {
		this.picTypeName = picTypeName;
	}
	
	public String getPicStatusName() {
		return picStatusName;
	}

	
	public void setPicStatusName(String picStatusName) {
		this.picStatusName = picStatusName;
	}
	
	public String getDatemin() {
		return datemin;
	}

	
	public void setDatemin(String datemin) {
		this.datemin = datemin;
	}

	
	public String getDatemax() {
		return datemax;
	}

	
	public void setDatemax(String datemax) {
		this.datemax = datemax;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("PicName",getPicName())
			.append("PicUrl",getPicUrl())
			.append("PicType",getPicType())
			.append("PicOrder",getPicOrder())
			.append("PicGroup",getPicGroup())
			.append("PicStatus",getPicStatus())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AppPictuerDTO == false) return false;
		if(this == obj) return true;
		AppPictuerDTO other = (AppPictuerDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

